package apps.AfterDlcs.afterDlcsBL.buff.myBuff.Base;

import apps.AfterDlcs.afterDlcsBL.Event;
import apps.AfterDlcs.afterDlcsBL.buff.Buff;
import apps.AfterDlcs.afterDlcsBL.buff.BuffKeys;
import apps.AfterDlcs.afterDlcsBL.hero.HeroBL;
import backs.dataBase.DBNormal;

public class BaseGetValueBuff extends Buff
{
    public static String DEFAULT_VALUE_DB="afterdlcsdefault";
    @Override
    public void handleEvent(Event event)
    {
        if(event.toHero==this.owner&&event.eventTurn==4&&event.key.equals(BuffKeys.GET_VALUE))
        {
            String key=(String)event.values[0];
            String value=HeroBL.getHeroValue(this.worldID,this.owner.heroID,key, DBNormal.getValue(DEFAULT_VALUE_DB,0,"hero_"+key,"0",true),true);
            event.values[1]=value;
        }
    }
}
